[NTG-context] Re: xmldoif: checking for contents of attribute

2023-08-25 Thread Hans Hagen
On 8/25/2023 1:45 PM, denis.ma...@unibe.ch wrote: -Ursprüngliche Nachricht- Von: Hans Hagen Gesendet: Freitag, 25. August 2023 09:06 An: Maier, Denis Christian (UB) ; mailing list for ConTeXt users Betreff: Re: [NTG-context] Re: xmldoif: checking for contents of attribute On 8/25/2023

[NTG-context] Re: xmldoif: checking for contents of attribute

2023-08-25 Thread denis.maier
> -Ursprüngliche Nachricht- > Von: Hans Hagen > Gesendet: Freitag, 25. August 2023 09:06 > An: Maier, Denis Christian (UB) ; mailing list for > ConTeXt users > Betreff: Re: [NTG-context] Re: xmldoif: checking for contents of attribute > > On 8/25/2023 8:22 AM, de

[NTG-context] Re: xmldoif: checking for contents of attribute

2023-08-25 Thread Hans Hagen
On 8/25/2023 8:22 AM, denis.ma...@unibe.ch wrote: Thanks for your help. I can use that, but why is this sort of double-checking necessary here? because containsa in a function that has checking while find is just the lua find .. so i've added a check in that one too now but no upload Hans

[NTG-context] Re: xmldoif: checking for contents of attribute

2023-08-25 Thread denis.maier
> -Ursprüngliche Nachricht- > Von: Thomas A. Schmitz > Gesendet: Donnerstag, 24. August 2023 16:35 > An: mailing list for ConTeXt users > Betreff: [NTG-context] Re: xmldoif: checking for contents of attribute > > > One way would be to do the search in Lua

[NTG-context] Re: xmldoif: checking for contents of attribute

2023-08-25 Thread denis.maier
> -Ursprüngliche Nachricht- > Von: Hans Hagen > Gesendet: Donnerstag, 24. August 2023 16:54 > An: ntg-context@ntg.nl > Betreff: [NTG-context] Re: xmldoif: checking for contents of attribute > > On 8/24/2023 4:11 PM, denis.ma...@unibe.ch wrote: > > Hi, > >

[NTG-context] Re: xmldoif: checking for contents of attribute

2023-08-24 Thread Hans Hagen
On 8/24/2023 4:11 PM, denis.ma...@unibe.ch wrote: Hi, I'm trying to check whether an attribute contains (or, actually starts with) a given string. I've tried a whole bunch of different combinations, but I've had no luck so far. Minimal example below. Anyone has a hint? Best, Denis

[NTG-context] Re: xmldoif: checking for contents of attribute

2023-08-24 Thread Thomas A. Schmitz
One way would be to do the search in Lua; when you have multiple searches to perform, that may be the easiest way to go. For example: \startxmlsetups xml:test \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{doc|element}{xml:*} \stopxmlsetups

[NTG-context] xmldoif: checking for contents of attribute

2023-08-24 Thread denis.maier
Hi, I'm trying to check whether an attribute contains (or, actually starts with) a given string. I've tried a whole bunch of different combinations, but I've had no luck so far. Minimal example below. Anyone has a hint? Best, Denis %

[NTG-context] Re: XML processing beginner's question

2023-08-22 Thread denis.maier
done that. But I don't seem to have the basic context of > > how the processing works in order. All I have so far is this as a > > starting > > point: > > > Really? I told you about the various commands \xmldoif, but there's nothing in > your starting point. I don't want

[NTG-context] Re: XML processing beginner's question

2023-08-21 Thread Thomas A. Schmitz
On 8/21/23 17:59, Michael Löscher wrote: Yes, I have done that. But I don't seem to have the basic context of how the processing works in order. All I have so far is this as a starting point: Really? I told you about the various commands \xmldoif, but there's nothing in your starting point

Re: [NTG-context] issue with lpath

2022-08-04 Thread Hans Hagen via ntg-context
p \startpar\xmlflush{#1}\stoppar \stopxmlsetups \startxmlsetups xml:blockquote \startblockquote\xmlflush{#1}\stopblockquote \stopxmlsetups \startxmlsetups xml:section:level3 \xmldoif{#1}{/blockquote} { \xmldoifnot{#1}{/p} { \section{\xmlflush{#1}} } }

Re: [NTG-context] How to check if buffer or block has content

2021-08-02 Thread Wolfgang Schuster via ntg-context
e existing commands we can use \doifelsebufferempty \doifelsebuffersomething \doifelsebuffernothing or (we already have \xmldoif... and \btxdoif...) \bufferdoifelseempty \bufferdoifelsesomething \bufferdoifelsenothing Wolfgang ___ I

Re: [NTG-context] Genealogy and context

2021-03-03 Thread Hans Hagen
\NC \xmlfirst{#1}{name/surname/text()} \NC \NR \BC gender \NC \xmlfirst{#1}{gender} \NC \NR \stoptabulate \stopxmlsetups \startxmlsetups xml:childref % \startsubsubject[title=Child] \xmlfirst{main}{/database/people/person[@handle='\xmlatt{#1}{hlink}']} % \stopsubsubject \stopxmlsetups \s

Re: [NTG-context] xmldoif, \startSECTION ... \stopSECTION and \setuphead

2019-05-16 Thread Pablo Rodriguez
On 5/16/19 8:45 PM, Wolfgang Schuster wrote: > Pablo Rodriguez schrieb am 16.05.2019 um 18:43: >> [...] >> After checking i-context, the options for the second pair of brackets are: >> >>KEY = VALUE >> >> Well, I think this is the standard case. Aren’t values inherited from >> \setuphead? What

Re: [NTG-context] xmldoif, \startSECTION ... \stopSECTION and \setuphead

2019-05-16 Thread Wolfgang Schuster
Pablo Rodriguez schrieb am 16.05.2019 um 18:43: Dear list, I have the following sample: \setuphead[chapter] [beforesection=\TeX, aftersection=\TeX] \starttext \startchapter[title=Chapter, beforesection=\ConTeXt, aftersection=\ConTeXt]

Re: [NTG-context] xmldoif, \startSECTION ... \stopSECTION and \setuphead

2019-05-16 Thread Pablo Rodriguez
On 5/16/19 6:43 PM, Pablo Rodriguez wrote: > [...] > What would be my approach to deal with "\xmldoif{#1}{.[@id='topic' and > contains(@class,'hidden')]}" in beforesection? > > I realize that "\definehead[specialchapter][chapter]" would be a > workaround,

[NTG-context] xmldoif, \startSECTION ... \stopSECTION and \setuphead

2019-05-16 Thread Pablo Rodriguez
After checking i-context, the options for the second pair of brackets are: KEY = VALUE Well, I think this is the standard case. Aren’t values inherited from \setuphead? What would be the valid keys for this case? I need to use \xmldoif in beforesection and aftersection. As far as I can see

Re: [NTG-context] XML xmldoif struggle!

2019-05-03 Thread Geert Verhaag
Hi Aditya, The ConTeXt team did a great job in writing the manual xml-mkiv.pdf, but I think it is not meant for a beginner. Its contents is rather overwhelming when trying it for the first time. For me, I don't use luatex a lot, so that adds to the difficulty of trying it out. Regards,

Re: [NTG-context] XML xmldoif struggle!

2019-05-02 Thread Aditya Mahajan
On Thu, 2 May 2019, Geert Verhaag wrote: Yes, I got it working! It is somewhat tricky. Trying to understanding the concepts behind all this isn't easy for me, but I'm bashing on. I also find understanding XML processing rules to be complicated. I simply convert the XML to a lua table, and

Re: [NTG-context] XML xmldoif struggle!

2019-05-02 Thread Geert Verhaag
prompt reply! The output Euro set! is printed always, it doesn't matter whether I put EURO or DOLLAR first?! Hi Geert, my fault, the conditional should read: \xmldoif{#1}{currency[position()==1 and contains(text(),'EURO')]} {Euro set!} I hope it works fine now. Pablo -- http

Re: [NTG-context] XML xmldoif struggle!

2019-05-02 Thread Pablo Rodriguez
On 5/1/19 9:28 PM, Geert Verhaag wrote: > Hoi Pablo, > > Thanks for your prompt reply! > > The output Euro set! is printed always, it doesn't matter whether I put > EURO or DOLLAR first?! Hi Geert, my fault, the conditional should read: \xmldoif{#1}{currency[position()==1

Re: [NTG-context] XML xmldoif struggle!

2019-05-01 Thread Geert Verhaag
all this is far too complex for me! The documentation simply isn't meant for beginners like me, sorry! Regards, Gerard On 01-05-19 13:20, Pablo Rodriguez wrote: On 4/30/19 9:58 PM, Geert Verhaag wrote: [...] \startxmlsetups xml:invoice:invoice   \xmlfirst{#1}{currency} \par   \xmldoif

Re: [NTG-context] XML xmldoif struggle!

2019-05-01 Thread Pablo Rodriguez
On 4/30/19 9:58 PM, Geert Verhaag wrote: > [...] > \startxmlsetups xml:invoice:invoice >   \xmlfirst{#1}{currency} \par >   \xmldoif{\xmlfirst{#1}{currency}}{contains(text(),'EURO')} { > Euro set! \par >   } > [...] > But the xmldoif command doesn't cause

[NTG-context] XML xmldoif struggle!

2019-04-30 Thread Geert Verhaag
Hi, I've the following XML tag in my XML file:   EURO . with invoice being the root tag! Now I have a setup defined as below (only part!): \startxmlsetups xml:invoice:invoice   \xmlfirst{#1}{currency} \par   \xmldoif{\xmlfirst{#1}{currency}}{contains(text(),'EURO')} { Euro set